	<div class="easyui-panel" title="个人成绩录入" data-options="fit:true" style="display: flex;flex-direction: column;">
		<p style="flex-grow: 0;">
			<label>选择班级：</label>
			<input id="xzbj" class="easyui-combobox" data-options="
				url:'banji/list',
				valueField:'id',
				textField:'name',
				panelHeight: 200,
				editable:false,
				icons:[{
			        iconCls:'icon-clear',
			        handler: function(e){
			        	$(e.data.target).textbox('clear');
			        	$('#div1').hide();
			    	}
			    }],
			"/>
			<label>选择学生:</label>
			<input id="xzxs" class="easyui-combobox" data-options="
				url:'grade/getStu?bjId=',
				valueField:'id',
				textField:'name',
				panelHeight: 200,
				editable:false,
				icons:[{
			        iconCls:'icon-clear',
			        handler: function(e){
			        	$(e.data.target).textbox('clear');
			        	$('#div1').hide();
			    	}
			    }],
			"/>
			<button class="easyui-linkbutton" data-options="iconCls:'icon-search'" id="cx">查询</button>
		</p>
		<div id="div1" style="flex-grow: 1; display: none; ">
			<table id="stugrid">
				<thead>
					<tr>
						<th data-options="field:'id',hidden:true">ID</th>
						<th  width="200" data-options="
						field:'student',
						sortable:true,
						formatter:function(val,row,index){
                           return row.student.stuNo;
                          }
						">学号</th>
						<th width="200" data-options="
						field:'course',
						sortable:true,
						formatter:function(val,row,index){
							return row.course.name
						}
						">课程</th>
						<th width="200" data-options="
						field:'grade',
						formatter:formatter2
						">成绩</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>
	<script type="text/javascript">
		$(function(){
			$('#xzbj').combobox({
				onSelect:function(d){
					var bjId=d.id;
					$('#xzxs').combobox({
						url:'grade/getStu?bjId='+bjId,
					})
					$('#xzxs').combobox('enable');
				}
			})
		var grid=$('#stugrid');
		$('#cx').bind('click',function(){
		var stuId=$('#xzxs').combobox('getValue');
		var bjId=$('#xzbj').combobox('getValue');
		if(bjId==0||stuId==0){
			$('#div1').hide();
			return;
		}else{
			$('#div1').show();
			xgcj(bjId,stuId);
		}
		grid.datagrid({
			idField:'id',
			url: 'grade/getgrcj?stuId='+stuId,
			fit:true,
			fitColumns:true,
			singleSelect:true,
			//rownumbers:true,
			pagination:true,
			pageSize:10,
			sortName:'id',
			sortOrder: 'asc',
			pageList:[10,25,50,100],
		});
		});
		})
		function formatter2(val,row,index){
			if(row.grade==null){
				row.grade="";
			}else{
				return '<input id="dd" value="'+row.grade+'"/>'
			}
		}
		//只能输入数字
		$("input[id='dd']").numberbox({
			min:0,
			precision:0
		});
		function xgcj(bjId,stuId){
			$('#stugrid').datagrid($.extend({},$.crudgrid.defaults,{
				url:'grade/getgrcj?stuId='+stuId,
				onLoadSuccess:function(data){
			            $("input[id='dd']").numberbox({
			            	onChange:function(grade,oldgrade){
				            	var grid=$('#stugrid').datagrid('getSelected');
								xg(grid.id,grade);
				            }
				        });  
			   	}
			}))
		};
		function xg(id,grade){
			if(!(/^[0-9]\d*$/.test(grade))){
				$.messager.alert('提示','请输入正整数','info');
				return;
			};
		$.post('grade/xgcj',{id:id,grade:grade},function(data){});
		}
	</script>